/*
 * Copyright (c) 2024. hallele, Inc All rights reserved.
 */

package cn.hallele.infrastructure.util;

import org.dromara.hutool.core.func.SerFunction;

/**
 * hallele_mc_core
 *
 * @author anle5
 * @since 2024/9/22 19:43
 */
public class EnumUtil extends org.dromara.hutool.core.util.EnumUtil {
    /**
     * 通过 某字段对应值 获取 枚举，获取不到时为 {@code null}
     *
     * @param condition 条件字段
     * @param value     条件字段值
     * @param <E>       枚举类型
     * @param <C>       字段类型
     * @return 对应枚举 ，获取不到时为 {@code null}
     */
    public static <E extends Enum<E>, C> E getBy(final HalFunction<E, C> condition, final C value) {
        return org.dromara.hutool.core.util.EnumUtil.getBy(condition, value);
    }

    public interface HalFunction<E, C> extends SerFunction<E, C> {
    }
}
